package net.uiiang.android.BiscuitBoxDemo.system;

import java.util.List;

import net.uiiang.android.BiscuitBox.utils.RunScript;

import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.content.Context;
import android.os.Bundle;

public class RunningAppProcesses extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
        List<ActivityManager.RunningAppProcessInfo> l = am.getRunningAppProcesses(); 
        
        for (RunningAppProcessInfo runningAppProcessInfo : l) {
            System.out.println(runningAppProcessInfo.processName+" -- "+runningAppProcessInfo.pid);
        }
        System.out.println(RunScript.runIt("ps"));
    }

}
